1
生成式人工智慧的演進:從規則到推理
AI011Lesson 1
00:00

生成式人工智慧的演進:從規則到推理

人工智慧的歷史標誌著一場根本性的轉變:從明確的人工程式設計,轉向基於模式的統計預測。這種演進使現代人工智慧能夠執行複雜的 推理 任務。

1. 什麼:規則為本時代

早期的人工智慧依賴於 專家系統。在這些系統中,每一個可能的回應或動作都是由人類以嚴格的 如果-那麼邏輯

  • 限制: 這些系統極其脆弱。它們無法處理細微差異、俚語、拼字錯誤,或任何超出其特定硬編碼程式的場景。

2. 為何:統計學突破

突破來自於處理大量未標記資料的能力。與手動規則不同, 大型語言模型(LLMs) 學習詞彙之間的統計關係。

  • 變換器(Transformer): 2017年推出的革命性模型架構。
  • 注意力機制: 變換器的核心組件,讓模型能權衡序列中不同詞語的重要性,以理解深層語境(例如,知道長段落中的「它」指代的是什麼)。

3. 如何:從預測到推理

現代生成式人工智慧根本上是 非決定性的。它計算「下一個詞元」的概率分佈,而非遵循固定的決策樹。

透過反覆根據整個前序內容預測最有可能的下一個單詞,模型產生創意內容,並看似能「推理」自然語言中提供的複雜指令。

概率陷阱
人工智慧不是事實資料庫;它是一台統計引擎。由於它僅預測最有可能出現的下一個單詞,因此可能陷入 「幻覺」——以絕對信心呈現錯誤資訊。
evolution_logic.py
TERMINALbash — 80x24
> Ready. Click "Run" to execute.
>
Question 1
What is the primary difference between rule-based chatbots and modern Generative AI?
Rule-based bots use neural networks, while GenAI uses decision trees.
Rule-based bots follow fixed scripts, while GenAI predicts responses based on patterns and probability.
Rule-based bots can reason, while GenAI only retrieves facts.
There is no difference; they are just different marketing terms.
Question 2
What does the 'Attention Mechanism' in a Transformer model do?
It ensures the user is paying attention to the output.
It searches the internet for the most accurate facts.
It allows the model to weight the importance of different parts of the input text.
It translates the text into binary code.
Challenge: Designing a Tutoring App
Apply your knowledge of AI evolution.
You are designing a tutoring app. You need to choose between a rule-based "if-then" system and an LLM.
Task 1
Identify a scenario where the rule-based system would fail but the LLM would succeed.
Solution:
Handling a student asking the same question in a creative or slang-heavy way (e.g., "Yo, how do I do math?" vs "Please explain the equations."). A rule-based system would likely throw an error if the exact phrasing wasn't programmed.
Task 2
Suggest a "Metaprompt" to ensure the LLM doesn't just give the answer but acts like a tutor.
Solution:
"You are a helpful tutor. Do not provide direct answers. Instead, ask leading questions to help the student find the solution themselves."